<?php $this->load->view('header');?>
<div class="page-container">
    <?php $this->load->view('sidebar');?>
    <!-- BEGIN CONTENT -->
    <div class="page-content-wrapper">
        <div class="page-content">
            <?php $this->load->view('sale/_sub_nav');?>
            <div class="row">
                <div class="col-md-12">
                    <?php echo form_open($this->uri->uri_string(), array('class'=>'form-horizontal','role'=>'form')); ?>
                    <div class="form-body">

                        <h3 class="form-section">学员情况</h3>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group<?php echo form_error('student_id') ? ' has-error' : ''; ?>">
                                    <label class="control-label col-md-3" ><span class="required">*</span>查找学员</label>
                                    <div class="col-md-6">
                                        <input type="text" name="student_id" class="form-control" id="all_students" style="width:250px" placeholder="支持模糊查找">
                                        <span class="help-block"><?php echo form_error('student_id'); ?></span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <h3 class="form-section">课程信息</h3>

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group<?php echo form_error('date') ? ' has-error' : ''; ?>">
                                    <label class="control-label col-md-3" ><span class="required">*</span>日期</label>
                                    <div class="col-md-6">
                                        <div class="input-group date date-picker">
                                            <input type="text" name="date" id="date" class="form-control" value="<?php echo set_value('date', isset($clue) ? $clue->birthday : ''); ?>" />
                                                <span class="input-group-btn">
                                                    <button class="btn default" type="button"><i class="fa fa-calendar"></i></button>
                                                </span>
                                        </div>
                                        <span class="help-block"><?php echo form_error('date'); ?></span>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6">
                                <div class="form-group<?php echo form_error('grade') ? ' has-error' : ''; ?>">
                                    <label class="control-label col-md-3" >年级</label>
                                    <div class="col-md-6">
                                        <select name="grade" id="grade" class="form-control" >
                                            <?php foreach($this->config->item('comm.grade') as $key=>$value):?>
                                                <option value="<?php echo $key;?>"><?php echo $value;?></option>
                                            <?php endforeach;?>
                                        </select>
                                        <span class="help-block"><?php echo form_error('grade'); ?></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group<?php echo form_error('subject') ? ' has-error' : ''; ?>">
                                    <label class="control-label col-md-3" ><span class="required">*</span>科目</label>
                                    <div class="col-md-6">
                                        <select name="subject" id="subject" class="form-control">
                                            <?php foreach($this->config->item('comm.subject') as $key=>$value):?>
                                                <option value="<?php echo $key;?>"><?php echo $value;?></option>
                                            <?php endforeach;?>
                                        </select>
                                        <span class="help-block"><?php echo form_error('subject'); ?></span>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6">
                                <div class="form-group<?php echo form_error('time') ? ' has-error' : ''; ?>">
                                    <label class="control-label col-md-3" >时间段</label>
                                    <div class="col-md-6">
                                        <select name="time" id="time" class="form-control" >
                                            <?php foreach($this->config->item('comm.class_time') as $key=>$value):?>
                                                <option value="<?php echo $key;?>"><?php echo $value;?></option>
                                            <?php endforeach;?>
                                        </select>
                                        <span class="help-block"><?php echo form_error('time'); ?></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group<?php echo form_error('remark') ? ' has-error' : ''; ?>">
                                    <label class="control-label col-md-3" ><span class="required">*</span>备注</label>
                                    <div class="col-md-6">
                                        <textarea name="remark" class="form-control"><?php echo set_value('remark', isset($track) ? $track->content : ''); ?></textarea>
                                        <span class="help-block"><?php echo form_error('remark'); ?></span>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6">
                                <div class="form-group<?php echo form_error('teacher_id') ? ' has-error' : ''; ?>">
                                    <label class="control-label col-md-3" >教师</label>
                                    <div class="col-md-6">
                                        <select name="teacher_id" id="teacher_id" class="form-control" >
                                            <?php if (isset($teachers) && is_array($teachers) && count($teachers)) :?>
                                                <?php foreach ($teachers as $teacher) :?>
                                                    <option value="<?php echo $teacher->teacher_id; ?>" <?php echo set_select('teacher', $teacher->teacher_id,$teacher->teacher_id ); ?>>
                                                        <?php echo(ucfirst($teacher->teacher_name)); ?>
                                                    </option>
                                                <?php endforeach; ?>
                                                <option value="0">无</option>
                                            <?php endif;?>
                                        </select>
                                        <span class="help-block"><?php echo form_error('teacher_id'); ?></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <h3 class="form-section"><?php echo lang('system_info'); ?></h3>

                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group<?php echo form_error('consultant') ? ' has-error' : ''; ?>">
                                <label class="control-label col-md-3" ><?php echo lang('consultant'); ?></label>
                                <div class="col-md-9">
                                    <select name="consultant" id="consultant" class="form-control" >
                                        <?php if (isset($consultants) && is_array($consultants) && count($consultants)) :?>
                                            <?php foreach ($consultants as $consultant) :?>
                                                <option value="<?php echo $consultant['id']; ?>" <?php echo set_select('consultant', $consultant['id'], $consultant['id']); ?>>
                                                    <?php echo(ucfirst($consultant['nickname'])); ?>
                                                </option>
                                            <?php endforeach; ?>
                                            <option value="0">无</option>
                                        <?php endif;?>
                                    </select>
                                    <span class="help-block"><?php echo form_error('consultant'); ?></span>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-actions fluid">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="col-md-offset-3 col-md-9">
                                    <button type="submit" class="btn green" name="save"><?php echo lang('action_save');?></button>
                                    <a href="<?php echo site_url('/teach/classes');?>" class="btn default"><?php echo lang('action_cancel');?></a>
                                </div>
                            </div>
                            <div class="col-md-6">
                            </div>
                        </div>
                    </div>
                    <?php echo form_close();?>
                </div>
            </div>
        </div>
    </div>    <!-- END CONTENT -->
</div>




<?php $this->load->view('footer');?>

<script type="text/javascript" src="assets/scripts/custom/class.js"></script>

<script>
    jQuery(document).ready(function() {
        App.init(); // initlayout and core plugins
        Class.init();
    });
</script>

</body>
<!-- END BODY -->
</html>

